package cn.hk.dept.service.impl;

import cn.hk.dept.domain.Area;
import cn.hk.dept.domain.vo.DeptVo;
import cn.hk.dept.mapper.AreaMapper;
import cn.hk.dept.service.AreaService;
import cn.hk.dept.service.DeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.redis.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 行政区划信息表 服务实现类
 * </p>
 *
 * @author xu
 * @since 2023-03-09
 */
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements AreaService {

    @Autowired
    private AreaMapper areaMapper;

    @Autowired
    private DeptService deptService;

    @Autowired
    private RedisCache redisCache;

    @Override
    public List<Area> getAreaList() {
        return areaMapper.selectAreaList();
    }

    @Override
    public List<DeptVo> getDeptVaccinesStockList(Long deptId, Long vaccinesId) {
//        //省
//            for (Area areaTree : areaTrees) {
//                //市
//                for (Area areaChild : areaTree.getAreaChildren()) {
//                    //区
//                    for (Area child : areaChild.getAreaChildren()) {
//                        //社区
//                        List<DeptVo> deptVaccinesList = deptService.getDeptVaccinesList(child,vaccinesId);
//                        child.setDeptChildren(deptVaccinesList);
//                    }
//
//                }
//            }

            return null;
    }
}
